
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

section.history(
    ng-if="vm.showHistorySection()"
)
    tg-history-tabs(
        show-comment-tab="vm.showCommentTab()"
        show-activity-tab="vm.showActivityTab()"
        on-active-comments="vm.onActiveHistoryTab(true)"
        on-active-activities="vm.onActiveHistoryTab(false)"
        active-tab="vm.viewComments",
        on-order-comments="vm.onOrderComments()"
        comments-num="vm.commentsNum"
        activities-num="vm.activitiesNum"
        on-reverse="vm.reverse"
    )
    tg-comments(
        ng-if="vm.viewComments"
        comments="vm.comments"
        on-delete-comment="vm.deleteComment(commentId)"
        on-restore-deleted-comment="vm.restoreDeletedComment(commentId)"
        on-edit-mode="vm.toggleEditMode(commentId)"
        on-add-comment="vm.addComment(callback)"
        on-edit-comment="vm.editComment(commentId, commentData, callback)"
        edit-mode="vm.editMode"
        reverse="vm.reverse"
        object="{{vm.id}}"
        type="vm.type"
        name="{{vm.name}}"
        loading="vm.loading"
        editing="vm.editing"
        deleting="vm.deleting"
        project="vm.project"
    )
    div(
        ng-if="!vm.viewComments"
        infinite-scroll="vm.nextActivityPage()"
        infinite-scroll-disabled="vm.disabledActivityPagination"
        infinite-scroll-immediate-check="false"
    )
        tg-history(
            model="vm.type"
            activities="vm.activities"
        )
